package io.github.jsp.util;

import java.text.ParseException;
import java.util.Date;
import org.quartz.CronExpression;

public class CronExpressionUtil {
    public static Date getNextRunTime(String cronExpression) {
        try {
            CronExpression cron = new CronExpression(cronExpression);
            return cron.getNextValidTimeAfter(new Date());
        } catch (ParseException e) {
            e.printStackTrace();
            return null;
        }
    }
}